package com.woniu.cinema.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.woniu.cinema.mapper.SeatMapper;
import com.woniu.cinema.domain.Seat;
import com.woniu.cinema.service.SeatService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 座位信息Service业务层处理
 * 
 * @author yy
 * @date 2021-04-16
 */
@Service
public class SeatServiceImpl implements SeatService
{
    @Autowired
    private SeatMapper seatMapper;

    /**
     * 查询座位信息
     * 
     * @param seatId 座位信息ID
     * @return 座位信息
     */
    @Override
    public Seat selectSeatById(Long seatId)
    {
        return seatMapper.selectSeatById(seatId);
    }

    /**
     * 查询座位信息列表
     * 
     * @param seat 座位信息
     * @return 座位信息
     */
    @Override
    public List<Seat> selectSeatList(Seat seat)
    {
        return seatMapper.selectSeatList(seat);
    }

    /**
     * 新增座位信息
     * 
     * @param seat 座位信息
     * @return 结果
     */
    @Override
    public int insertSeat(Seat seat)
    {
        return seatMapper.insertSeat(seat);
    }

    /**
     * 修改座位信息
     * 
     * @param seat 座位信息
     * @return 结果
     */
    @Override
    public int updateSeat(Seat seat)
    {
        return seatMapper.updateSeat(seat);
    }

    /**
     * 批量删除座位信息
     * 
     * @param seatIds 需要删除的座位信息ID
     * @return 结果
     */
    @Override
    public int deleteSeatByIds(Long[] seatIds)
    {
        return seatMapper.deleteSeatByIds(seatIds);
    }

    /**
     * 删除座位信息信息
     * 
     * @param seatId 座位信息ID
     * @return 结果
     */
    @Override
    public int deleteSeatById(Long seatId)
    {
        return seatMapper.deleteSeatById(seatId);
    }

    @Override
    @Transactional
    public int updateBatchSeatStatus(List<Long> seatIdList) {
        return seatMapper.updateBatchSeatStatus(seatIdList);

    }

    @Override
    @Transactional
    public int revertBatchSeatStatus(List<Long> seatIdList) {

        return seatMapper.revertBatchSeatStatus(seatIdList);
    }
}
